package tasks.leetcode.任务调度;

import java.util.Scanner;

public class Answer005 {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int n = scanner.nextInt();
            int len = scanner.nextInt();
            int[] jobCount = new int[len];
            for (int i = 0; i < len; i++) {
                jobCount[i] = scanner.nextInt();
            }
            solution(n, jobCount);
        }
    }

    private static void solution(int n, int[] jobCount) {
        int time = 0;
        int remaining = 0;
        for (int count : jobCount) {
            if (count + remaining > n) {
                remaining = count + remaining - n;
            } else {
                remaining = 0;
            }
            time++;
        }
        time += remaining / n;
        if (remaining % n > 0) {
            time++;
        }
        System.out.println(time);
    }
}